<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // Object.entries ES8 将对象转化为二维数组
    const arr=Object.entries({
      name:'尚硅谷'
    })
    console.log(arr);//[['name','尚硅谷']]

    // Object.fromEntries(arr) ES10 将二维数组转化为对象
    const m=new Map([
      ['name','zhangsan']
    ])
    const obj1=Object.fromEntries(m)
    console.log(obj1);//{name:"zhangsan"}
  </script>
</body>
</html>